using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace AdaptiveHelpDesk
{
    class RestoreTaskModel
    {
        public RestoreTaskModel()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("Task Model\\TaskModel.xml");

            XmlElement Steps = (XmlElement)doc.DocumentElement.FirstChild;

            XmlElement SearchCustomer = (XmlElement)Steps.GetElementsByTagName("SearchCustomer")[0];
            SearchCustomer.ChildNodes[0].InnerText = "Incomplete";
            SearchCustomer.ChildNodes[1].InnerText = "Incomplete";
            SearchCustomer.ChildNodes[2].InnerText = "Incomplete";

            XmlElement LogCall = (XmlElement)Steps.GetElementsByTagName("LogCall")[0];
            LogCall.ChildNodes[0].InnerText = "Incomplete";
            XmlElement CallCat = (XmlElement)LogCall.GetElementsByTagName("Call_Categorisation")[0];
            CallCat.ChildNodes[0].InnerText = "Incomplete";
            CallCat.ChildNodes[1].InnerText = "Incomplete";
            CallCat.ChildNodes[2].InnerText = "Incomplete";
            XmlElement CallClass = (XmlElement)LogCall.GetElementsByTagName("Call_Classification")[0];
            CallClass.ChildNodes[0].InnerText = "Incomplete";
            CallClass.ChildNodes[1].InnerText = "Incomplete";

            XmlElement AssignCall = (XmlElement)Steps.GetElementsByTagName("AssignCall")[0];
            AssignCall.ChildNodes[0].InnerText = "Incomplete";
            AssignCall.ChildNodes[1].InnerText = "Incomplete";

            XmlElement ProvideSol = (XmlElement)Steps.GetElementsByTagName("ProvideSolution")[0];
            ProvideSol.ChildNodes[0].InnerText = "Incomplete";
            XmlElement SolClass = (XmlElement)ProvideSol.GetElementsByTagName("Solution_Classification")[0];
            SolClass.ChildNodes[0].InnerText = "Incomplete";
            SolClass.ChildNodes[1].InnerText = "Incomplete";

            XmlElement Current = (XmlElement)doc.DocumentElement.LastChild;
            Current.InnerText = "";

            doc.Save("Task Model\\TaskModel.xml");
        }
    }
}
